package com.zsrt.javaweb.bbu.book.service.impl;

import java.util.List;

import com.zsrt.javaweb.bbu.book.service.BookShopService;
import com.zsrt.javaweb.bbu.book.service.Cashier;

public class CashierImpl implements Cashier {

	private BookShopService bookShopService;
	
	public void setBookShopService(BookShopService bookShopService) {
		this.bookShopService = bookShopService;
	}




	/**
	 * 一个事务方法调用另外一个事务方法
	 */
	@Override
	public void checkout(String username, List<Integer> isbns) {
		
		for(Integer isbn: isbns){
			bookShopService.purchase(username, isbn);
		}

	}

}
